#!/usr/bin/env node

const log = console.log
if (process.argv.length !== 4) {
    console.error('命令行参数格式不正确。正确格式: cmd user_name password')
    process.exit(1)
}

let userName = process.argv[2],
    password = process.argv[3]

log('username: ', userName)
log('password: ', password)

const msg = `${userName}: ${password}`

const buf = Buffer.from(msg)
log('base64:', buf.toString('base64'))

log('base64:', btoa(msg))
